package Java攻略._1_基础知识._2_方法引用;

import java.util.function.Consumer;
import java.util.stream.Stream;

public class _8_利用方法引用访问println方法 {

    public static void main(String[] args) {

        Stream.of(3,1,4,1,5,9)
                .forEach(x -> System.out.print(x));

        System.out.println("\n");

        Stream.of(3,1,4,1,5,9)
                .forEach(System.out::print);

        System.out.println("\n");

        Consumer<Integer> printer = System.out::print;
        Stream.of(3,1,4,1,5,9)
                .forEach(printer);
    }
}
